package com.lengchangjing.StructuralPatterns.CompositePattern;

public class Client {
    public static void main(String[] args) {
        Component root = new Composite();
        root.Add(new Leaf());
        root.Add(new Leaf());

        Component composite = new Composite();
        composite.Add(new Leaf());
        composite.Add(new Leaf());

        root.Add(composite);

        Component componsite2 = new Composite();
        composite.Add(componsite2);

        componsite2.Add(new Leaf());
        componsite2.Add(new Leaf());

        root.Operaton(2);
    }
}
